﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:tb="http://www.hardcodet.net/taskbar"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    d1p1:Ignorable="d" 
                    xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:wallet="clr-namespace:Liberty.Wallet">
    
    <wallet:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />

    <!-- The taskbar context menu - the first row is a dummy to show off simple data binding -->
    <!--
        The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
        reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
  -->
    <ContextMenu x:Shared="false" x:Key="SysTrayMenu">
        <MenuItem Header="Show Window" Command="{Binding ShowWindowCommand}" />
        <MenuItem Header="Hide Window" Command="{Binding HideWindowCommand}" />
        <Separator />
        <MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
    </ContextMenu>


    <!-- the application's NotifyIcon - started from App.xaml.cs. Declares its own view model. -->
    <tb:TaskbarIcon x:Key="NotifyIcon"
                    IconSource="/bitcoin.ico"
                    ToolTipText="{Binding ToolTipText}"
                    DoubleClickCommand="{Binding ShowWindowCommand}"
                    ContextMenu="{StaticResource SysTrayMenu}"
                    DataContext="{Binding NotifyIcon, Source={StaticResource Locator}}">
    </tb:TaskbarIcon>
</ResourceDictionary>